clear all
clear matrix
set type double, perm
set varabbrev off, perm
*cd "~/Dropbox/Do_Index_Funds_Monitor/replication_code_and_data"
*cd "~/Dropbox/LAVORO/UNIVERSITA'/RICERCA/Russell_Banding/replication_code_and_data"


*This Stata dofile and the accompanying data files reproduce all figures and tables in 
*"Do Index Funds Monitor?" by Heath, Macciocchi, Michaely, Ringgenberg (RFS 2021)
*The data used in the paper may not be shared publicly.
*To protect this private data, we have replaced firm identifiers
*from all data providers with anonymized firm ids, which are consistent throughout the data.


*Figure 1
use passiveaum, replace
twoway line frac_index year, sort yaxis(1) lwidth(0.6) lcolor(eltblue) lpattern(dash) ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%", angle(horizontal)) ytitle("") graphregion(color(white)) bgcolor(white) xlabel(1995 2000 2005 2010 2015) ///
      || line aum1 year, yaxis(2) lwidth(0.6) lcolor(edkblue) ylabel(0 "0" 1 "$1T" 2 "$2T" 3 "$3T" 4 "$4T" 5 "$5T" 6 "$6T", axis(2) format(%5.0f) angle(horizontal)) ytitle("", axis(2)) legend(order(2 1))





*Figure 2 A
use Russell07, clear
twoway (scatter R2000 caprank if switcher==0, msize(small) mcolor(eltblue) xlab(#10) ///
        xline(838, lcolor(gs1) lpat(dash)) xline(1210, lcolor(gs1) lpat(dash)) xline(1000, lwidth(0.5) lcolor(black))) ///
       (scatter R2000 caprank if switcher!=0, msize(vlarge) m(X) mcolor(edkblue)), ///
       ytitle(Assigned to Russell 2000) xtitle(Mkt. Cap. Rank) ylab(#1, nogrid) ///
	   title("{stSerif:{bf:(a)} June 2007 Index Assignment}", pos(6)) legend(lab(1 "Stayers") lab(2 "Switchers") pos(12)) graphregion(color(white))

*Figure 2 B
use Russell_sample_100, replace
keep if year==2007 & cohort==2007
twoway (scatter R2000 caprank if switcher==0, msize(small) mcolor(eltblue) xlab(#10) ///
        xline(838, lcolor(gs1) lpat(dash)) xline(1210, lcolor(gs1) lpat(dash)) xline(1000, lwidth(0.5) lcolor(black))) ///
       (scatter R2000 caprank if switcher!=0, msize(vlarge) m(X) mcolor(edkblue)), ///
       ytitle(Assigned to Russell 2000) xtitle(Mkt. Cap. Rank) ylab(#1, nogrid) ///
	   xscale(range(500 1500)) ///
	   title("{stSerif:{bf:(b)} 2007 Cohort Firms}", pos(6)) legend(lab(1 "Stayers") lab(2 "Switchers") pos(12)) graphregion(color(white))








*Figure 3
use Russell_sample_100, replace
keep if year==cohort-1
*3a
preserve
keep if upper==1
rdcv MFPassive caprank_rel_to_upper, thr(0) bw(200) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off)  aspectratio(0.4) ///
  yti(Passive Fund Ownership (% MktCap)) xti(Rank Relative to Upper Band))
gen coarse_caprank = floor(caprank_rel_to_upper / 10) * 10 + 5
drop if coarse_caprank > 100 | coarse_caprank < -100
collapse (mean) MFPassive, by(coarse_caprank)
graph addplot pci 0 0 15 0, lp(dash) lcolor(black) graphregion(color(white))
graph addplot scatter MFPassive coarse_caprank, msymbol(O) mcolor(black) ///
     graphregion(color(white)) aspectratio(0.4) title("{stSerif:{bf:(a)} Pretreatment index fund ownership, Upper band}")
restore
*3b
preserve
keep if upper==0
rdcv MFPassive caprank_rel_to_lower, thr(0) bw(200) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off)  aspectratio(0.4) ///
  yti(Passive Fund Ownership (% MktCap)) xti(Rank Relative to Lower Band))
gen coarse_caprank = floor(caprank_rel_to_lower / 10) * 10 + 5
drop if coarse_caprank > 100 | coarse_caprank < -100
collapse (mean) MFPassive, by(coarse_caprank)
graph addplot pci 0 0 15 0, lp(dash) lcolor(black) aspect(0.5) graphregion(color(white))
graph addplot scatter MFPassive coarse_caprank, msymbol(O) mcolor(black) aspectratio(0.4) title("{stSerif:{bf:(b)} Pretreatment index fund ownership, Lower band}")
restore
*3c
preserve
keep if upper==1
rdcv bcf caprank_rel_to_upper, thr(0) bw(200) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off) aspectratio(0.4) ///
  yti(E-Index) xti(Rank Relative to Upper Band))
gen coarse_caprank = floor(caprank_rel_to_upper / 10) * 10 + 5
drop if coarse_caprank > 100 | coarse_caprank < -100
collapse (mean) bcf, by(coarse_caprank)
graph addplot pci 0 0 6 0, lp(dash) lcolor(black) aspect(0.5) graphregion(color(white))
graph addplot scatter bcf coarse_caprank, msymbol(O) mcolor(black) aspectratio(0.4) title("{stSerif:{bf:(c)} Pretreatment E-Index, Upper band}")
restore
*3d
preserve
keep if upper==0
rdcv bcf caprank_rel_to_lower, thr(0) bw(200) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off) aspectratio(0.4) ///
  yti(E-Index) xti(Rank Relative to Lower Band))
gen coarse_caprank = floor(caprank_rel_to_lower / 10) * 10 + 5
drop if coarse_caprank > 100 | coarse_caprank < -100
collapse (mean) bcf, by(coarse_caprank)
graph addplot pci 0 0 6 0, lp(dash) lcolor(black) aspect(0.5) graphregion(color(white))
graph addplot scatter bcf coarse_caprank, msymbol(O) mcolor(black) aspectratio(0.4) title("{stSerif:{bf:(d)} Pretreatment E-Index, Lower band}")
restore
*3e
preserve
keep if upper==1
rdcv rtn_julymay caprank_rel_to_upper, thr(0) bw(200) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off) aspectratio(0.4) ///
  yti(11 Month Prior Return) xti(Rank Relative to Upper Band))
gen coarse_caprank = floor(caprank_rel_to_upper / 10) * 10 + 5
drop if coarse_caprank > 100 | coarse_caprank < -100
collapse (mean) rtn_julymay, by(coarse_caprank)
graph addplot pci -0.4 0 0.4 0, lp(dash) lcolor(black) aspect(0.5) graphregion(color(white))
graph addplot scatter rtn_julymay coarse_caprank, msymbol(O) mcolor(black) aspectratio(0.4) title("{stSerif:{bf:(e)} Pretreatment stock returns, Upper band}")
restore
*3f
preserve
keep if upper==0
rdcv rtn_julymay caprank_rel_to_lower, thr(0) bw(200) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off) aspectratio(0.4) ///
  yti(11 Month Prior Return) xti(Rank Relative to Lower Band))
gen coarse_caprank = floor(caprank_rel_to_lower / 10) * 10 + 5
drop if coarse_caprank > 100 | coarse_caprank < -100
collapse (mean) rtn_julymay, by(coarse_caprank)
graph addplot pci -0.4 0 0.4 0, lp(dash) lcolor(black) aspect(0.5) graphregion(color(white))
graph addplot scatter rtn_julymay coarse_caprank, msymbol(O) mcolor(black) aspectratio(0.4) title("{stSerif:{bf:(f)} Pretreatment stock returns, Lower band}")
restore





*Figure 4
use simulated_data, replace
*4a
rdcv outcome forcing, thr(0) bw(80) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off) ///
  yti(Simulated Outcome) xti(Forcing Variable))
preserve
gen coarse_forcing = floor(forcing / 10) * 10 + 5
drop if coarse_forcing > 100 | coarse_forcing < -100
collapse (mean) outcome, by(coarse_forcing)
graph addplot scatter outcome coarse_forcing, msymbol(O) mcolor(black) graphregion(color(white))
graph addplot pci -60 0 60 0, lp(dash) lcolor(black) aspect(0.5) title("{stSerif:{bf:(a)} No measurement error}")
restore
*4b
rdcv outcome forcing2, thr(0) bw(80) ci level(99) noscatter vce(r) ///
  lineopt(lwidth(0.5) lcolor(navy)) gropt( legend(off) ///
  yti(Simulated Outcome) xti(Forcing Variable With Noise))
preserve
gen coarse_forcing2 = floor(forcing2 / 10) * 10 + 5
drop if coarse_forcing2 > 100 | coarse_forcing2 < -100
collapse (mean) outcome, by(coarse_forcing2)
graph addplot scatter outcome coarse_forcing2, msymbol(O) mcolor(black) graphregion(color(white))
graph addplot pci -60 0 60 0, lp(dash) lcolor(black) aspect(0.5) title("{stSerif:{bf:(a)} With measurement error}")
restore







*Figure 5
use Russell_sample_100, replace
local var passivefund_own_R2000
drop if `var'==.
gen rel_year = year - cohort
collapse (mean) `var' (sem) `var'_SE = `var', by(upper switcher rel_year)
preserve
keep if upper==1
replace switcher = 1 if switcher==-1
reshape wide `var' `var'_SE, i(rel_year) j(switcher)
save temp, replace
restore
keep if upper==0
reshape wide `var' `var'_SE, i(rel_year) j(switcher)
append using temp
rm temp.dta
label var `var'0 "Stayers"
label var `var'1 "Switchers"
gen lb0 = `var'0 - 2*`var'_SE0 
gen ub0 = `var'0 + 2*`var'_SE0 
gen lb1 = `var'1 - 2*`var'_SE1
gen ub1 = `var'1 + 2*`var'_SE1
gen lower = upper==0
gen lower2 = "Lower Band (R1000 {&rarr} R2000)" if lower==1
replace lower2 = "Upper Band (R2000 {&rarr} R1000)" if lower==0
twoway (line `var'0 rel_year, lwidth(0.75) col(eltblue) graphregion(color(white))) ///
       (line `var'1 rel_year, lwidth(0.75) col(edkblue) lpat(dash) graphregion(color(white))) ///
	   (rcap lb0 ub0 rel_year, col(black) graphregion(color(white))) ///
	   (rcap lb1 ub1 rel_year, col(black) graphregion(color(white))), ///
    by(lower2, note("") graphregion(color(white)) bgcolor(white)) xlabel(-4(1)3) ylabel(0(1)2.5) legend(order(2 1)) ///
	graphregion(color(white)) ///
	xtitle(Year Relative to Index Assignment) ///
	ytitle(Ownership by Russell 2000 Index Funds) ///
	yla(, format(%9.1f)) xline(-0.5, lcolor(black) lwidth(0.25))


*Figure	6
use fundfamilies, replace
scatter voted_with_mgmt frac_passive [w=tna_total], msymbol(circle_hollow) legend(off) ///
	ylabel(0 "0%" 0.2 "20%" 0.4 "40%" 0.6 "60%" 0.8 "80%" 1 "100%") ///
	xlabel(0 "0%" 0.2 "20%" 0.4 "40%" 0.6 "60%" 0.8 "80%" 1 "100%") ///
	xtitle(Passive Fraction of Assets Under Management) ytitle(Voted with Management) ///
	text(0.715 0.635 "Vanguard", size(small) place(c))  ///
	text(0.71 0.865 "Blackrock", size(small) place(c))  ///
	text(0.58 0.91 "State Street", size(small) place(c))  ///
	text(0.575 0.125 "Fidelity", size(small) place(c))  ///
	text(0.091 0.015 "Dimensional Fund Advisors", size(small) place(e))  ///
	text(0.76 0.00 "Capital Group", size(small) place(e))  ///
	text(0.445 0.05 "T. Rowe Price", size(small) place(e))  ///
	|| lfit voted_with_mgmt frac_passive [w=tna_total], lpattern(dash) lcolor(red) lwidth(0.9) ///
	graphregion(color(white)) bgcolor(white) xline(1, lwidth(0.2) lcolor(black))
	









*Table 1
use fundyear_panel, replace
tabstat tna_latest exp_ratiow, s(mean sd p10 median p90 co) c(stat) by(indexfund)
codebook fundid_anon if indexfund==1
codebook fundid_anon if activefund==1
use fundholdings_byyear, replace
tabstat nholdings, s(mean sd p10 median p90 co) c(stat) by(indexfund)






*Table 2
use Russell_sample_100, replace
tabstat ME passivefund_own_R2000 passivefund_own_R1000 MFPassive MFActive delta totalcomp equityvscash ///
        bcf6 ceo_turnover indpt_board_pct bcf bcf5 supermajority_req ///
		limitspecialmeet writtenconsent dualclass, s(mean sd p10 median p90 co) c(stat)






*Table 3
use Russell_sample_100, replace
reghdfe passivefund_own_R2000 R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe passivefund_own_R1000 R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe MFPassive R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe MFActive R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe allother R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)






*Table 4
use fundvotes, replace
tabstat votedyes votedno abstained didnotvote, by(indexfund)
tabstat votedyes votedno abstained didnotvote if mgmt_against==0 & iss_against==0, by(indexfund)
tabstat votedyes votedno abstained didnotvote if mgmt_against==1 & iss_against==1, by(indexfund)
tabstat votedyes votedno abstained didnotvote if mgmt_against==0 & iss_against==1, by(indexfund)
tabstat votedyes votedno abstained didnotvote if mgmt_against==1 & iss_against==0, by(indexfund)
tab votedyes
tab votedyes if mgmt_against==0 & iss_against==0
tab votedyes if mgmt_against==1 & iss_against==1
tab votedyes if mgmt_against==0 & iss_against==1
tab votedyes if mgmt_against==1 & iss_against==0







*Table 5
use fundvotes, replace
keep if contentious_vote==1
gen activefund =  (indexfund==0)
reghdfe voted_with_mgmt indexfund, a(firmid_anon2 year) cl(fundid_anon2 firmid_anon2)
reghdfe voted_with_mgmt indexfund c.exp_ratiow#c.indexfund c.exp_ratiow#c.activefund, a(firmid_anon2 year) cl(fundid_anon2 firmid_anon2)
reghdfe voted_with_mgmt indexfund, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe voted_with_mgmt indexfund c.exp_ratiow#c.indexfund c.exp_ratiow#c.activefund, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)







*Table 6
use fundvotes, replace
keep if contentious_vote==1
reghdfe voted_with_mgmt indexfund if item_board==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe voted_with_mgmt indexfund if item_compensation==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2) 
reghdfe voted_with_mgmt indexfund if item_disclosure==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe voted_with_mgmt indexfund if item_E==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)






*Table 7
use blockholding_disclosure, replace
probit frac_13D frac_passive, cl(mgmt_cd) dif
mfx
probit frac_13D frac_passive logAUM, cl(mgmt_cd)
mfx
probit frac_13D frac_passive n_blocks, cl(mgmt_cd)
mfx





*Table 8 Panel A
use fundvotes, replace
keep if contentious_vote==1
reghdfe votedyes indexfund if shprop==0, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe votedno indexfund if shprop==0, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe abstained indexfund if shprop==0, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe votedyes indexfund if shprop==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe votedno indexfund if shprop==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)
reghdfe abstained indexfund if shprop==1, a(firmid_anon2#year) cl(fundid_anon2 firmid_anon2)

*Table 8 Panel B
use Russell_sample_100, replace
reghdfe n_contentious_mgmtprop R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe frac_contentious_mgmtprop R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe frac_mgmtprop_passed R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe n_contentious_shprop R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe frac_contentious_shprop R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe frac_shprop_passed R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)




*bcf is the Bebchuk Cohen Ferrell E-Index
*bcf6 is golden parachute, bcf5 is poison pill


*Table 9 Panel A
use Russell_sample_100, replace
reghdfe delta R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe totalcomp R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe equityvscash R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe bcf6 R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe ceo_turnover R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)

*Table 9 Panel B
use Russell_sample_100, replace
reghdfe indpt_board_pct R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe bcf R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe bcf5 R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe supermajority_req R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe limitspecialmeet R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe writtenconsent R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe dualclass R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)






*Table 10
use Russell_sample_100, replace
reghdfe logQ R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe logqtot R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe logMB R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)
reghdfe ROA R1000_to_R2000 R2000_to_R1000, a(firmid_anon#cohort year) cl(firmid_anon year)






